﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;

namespace DMS.Business.Modules.Persister.Delegate {
    public class DelegateDbTransaction : IDbTransaction
    {
        private readonly IDbTransaction _transaction;

        public IDbTransaction OriginalDbTransaction
        {
            get { return _transaction; }
        }

        public void Dispose()
        {
            _transaction.Dispose();
        }

        public void Commit()
        {
            _transaction.Commit();
        }

        public void Rollback()
        {
            _transaction.Rollback();
        }

        public IDbConnection Connection
        {
            get { return _transaction.Connection; }
        }

        public IsolationLevel IsolationLevel
        {
            get { return _transaction.IsolationLevel; }
        }

        public DelegateDbTransaction(IDbTransaction transaction)
        {
            _transaction = transaction;
        }
    }
}
